#!/bin/sh
#
# nanoRC init script for very early booting.
# (c) dangbinghoo@gmail.com  2011
#     playpenguin.org
#

. /etc/init.d/rcfunctions

# nanoRC info
# NOTE: this message should not be removed or modified for change author.
#       nanoRC was released under GPL, but I just have copyright.
#
echo -ne "${BRACKET}"
rc_spline "="
echo -ne "${NORMALC}"
echo -e "         ${IMPORTT}nanoRC${NORMALC} system, version ${SUCCESS}0.2.3${NORMALC} (2011-11-17)"
echo "           : http://sourceforge.net/p/nanorc/."
echo -ne "${BRACKET}"
rc_spline "="
echo -ne "${NORMALC}"

# device type
if [ -f /etc/devicetype ];then
	. /etc/devicetype
	echo -e "          Welcom to ${SUCCESS}${device_type}${NORMALC} linux system."
	rc_spline "-"
fi

echo -e "${INFOMSG}Starting system...${NORMALC}"

# Mounting proc 
rc_do_msg "Mounting proc pesudo file sytem ..."
/bin/mount -t proc none /proc
/bin/mount -t sysfs none /sys

if [ -f /proc/meminfo ];then
	# done
	rc_status "${DE_msg}"
fi

rc_do_msg "Mounting devpts... "
/bin/mkdir /dev/pts
/bin/mount -t devpts devpts /dev/pts
rc_status "${DE_msg}"

/bin/mount -t tmpfs /tmp /tmp

#/bin/mount -t tmpfs -o mode=0755 none /dev
#/bin/mkdir /dev/shm
#/bin/mount -t tmpfs -o mode=0755 /var /var
#/bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
#echo  " * Starting mdev... "
#/sbin/mdev -s

rc_do_msg "Remounting root rw... "
mount -o remount,rw /
rc_status "${DE_msg}"

rc_do_msg  "Setting hostname... "
hostname -F /etc/conf.d/hostname
rc_status "${DE_msg}"

